Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Which of the following regular expressions de... Start Learning for Free
Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?
  • a)
    (0 + 1) * 11(0 + 1) *
  • b)
    0 * 110 *
  • c)
    0 * 10 * 10 *
  • d)
    (0 + 1) * 1(0 + 1) * 1 (0 + 1) *
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
Which of the following regular expressions describes the language over...
By looking at option A and D clearly not feasible solution.
Between B and C both contains exactly two 1's but in option B, both 1 will always come together where as in C it is general string.
View all questions of this test
Most Upvoted Answer
Which of the following regular expressions describes the language over...
Regular Expression to describe the language consisting of strings that contain exactly two 1s

To describe the language consisting of strings that contain exactly two 1s, the regular expression given in option 'C' is:

0 * 10 * 10 *

Let's break down this regular expression and explain it in detail:

0 * - This part of the regular expression allows for any number (including zero) of 0s before the first 1.

1 - This ensures that there is exactly one 1 after the initial 0s.

0 * - This allows for any number (including zero) of 0s between the two 1s.

1 - This ensures that there is exactly one 1 after the intermediate 0s.

0 * - This allows for any number (including zero) of 0s after the second 1.

By combining these elements, the regular expression ensures that there are exactly two 1s in the string, with any number of 0s before, between, and after them.

Example:

Let's consider some examples to verify if the regular expression matches strings that contain exactly two 1s.

1. 001010: This string matches the regular expression because it contains exactly two 1s (at positions 3 and 5) and any number of 0s.

2. 10001: This string also matches the regular expression because it contains exactly two 1s (at positions 1 and 4) and any number of 0s.

3. 101010: This string does not match the regular expression because it contains more than two 1s.

4. 0001000: This string does not match the regular expression because it contains only one 1.

Hence, the regular expression 0 * 10 * 10 * matches the language consisting of strings that contain exactly two 1s.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer?
Question Description
Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer?.
Solutions for Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer?, a detailed solution for Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? has been provided alongside types of Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following regular expressions describes the language over {0, 1} consisting of strings that contain exactly two 1's?a)(0 + 1) * 11(0 + 1) *b)0 * 110 *c)0 * 10 * 10 *d)(0 + 1) * 1(0 + 1) * 1 (0 + 1) *Correct answer is option 'C'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev